<!DOCTYPE html>
<html xmlns:layout="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
	layout:decorate="~{common/layout}">

<head>
	<meta charset="UTF-8">
	<title>血糖记录管理系统</title>
	<style scoped lang="less">

	</style>
</head>

<body>
	<div layout:fragment="fragment_body">
		<van-row>
			<van-nav-bar
			  title="血糖记录"
			  left-text="返回"
			  left-arrow
			  @click-left="onClickLeft"
			/>
		</van-row>
		<van-row>
			<van-empty v-if="sugars == null || sugars.length == 0" description="暂无血糖记录" ></van-empty>
			<van-cell-group v-for="(sugar, index) in sugars" :key="index" @click="sugarCilck(sugar)">
				<van-cell :title="sugar.sugarDate" :value="sugar.sugarValue" />
			</van-cell-group>
		</van-row>
	</div>
</body>
<script type="text/javascript" layout:fragment="fragment_script">
	let vueData = {
		activeMenu: 'my',
		sugars: []
	}
	let vueComputed = {

	}
	let vueMethods = {
		getSugars() {
			let that = this
			postRequst('/user/getSugarRecords', {}, true).then(function (resp) {
				that.sugars = resp.rows
			})
		},
		onClickLeft(){
			window.location.href='/user/my'
		},
		sugarCilck(sugar){
			
		},
	}
	function vueCreated() {
		let that = this
		that.getSugars()
	}
</script>

</html>